<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Movie home</title>
	<link type="text/css" rel="stylesheet" href="css/dth.css" />
	<style>
.menu6 {
	box-shadow: 6px 11px 10px;
}
</style>
</h:head>

<h:body>

	<ui:insert name="header">
		<ui:include src="/header/header_dth.xhtml" />
	</ui:insert>
	<div>
		<div class="dth_body_home">
			<ui:insert name="header_banner">
				<ui:include src="/header/header_banner.xhtml" />
			</ui:insert>
			<div class="dth_content_home">
				<p:ajaxStatus
					style="bottom: 68%;
				    height: 32px;
				    position: fixed;
				    right: 50%;
				    width: 32px;
				    z-index: 99999;">
					<f:facet name="start">
						<p:graphicImage value="images/loading.gif" />
					</f:facet>

					<f:facet name="complete">
						<h:outputText value="" />
					</f:facet>
				</p:ajaxStatus>
				<p:growl id="growl" showDetail="true" sticky="false" />
				<h:form>
					<h:panelGroup id="mainform">
						<p:dataGrid var="item" value="#{movieBean.listMovie}" columns="1"
							rows="3" paginator="true" paginatorPosition="bottom">
							<div
								style="width: 100%; height: 250px; float: left; margin-bottom: 10px; border-bottom: 1px solid #CA96D9;">
								<div
									style="width: 15%; height: 100%; float: left; text-align: center; display: inline;">
									<p:graphicImage style="width:178px;height:250px"
										value="images/#{item.image}"></p:graphicImage>
								</div>
								<div
									style="width: 84%; height: 100%; float: left; margin-left: 10px">
									<div
										style="background: none repeat scroll 0 0 #CA96D9; color: #FFFFFF; float: left; height: 15%; padding-left: 2%; width: 98%;">
										<h:outputText style="font-size: 18px;font-weight: bold;"
											value="#{item.movieName}"></h:outputText>


										<div style="font-size: 15px; float: right;">
											<p:commandButton update=":dlgform:dlgOrder"
												rendered="#{loginBean.role==4}" oncomplete="dlg.show()"
												value="#{msg['movie_home_btnbook']}"
												style="float:right ;height: 30px;margin-top:5px;width: 158px;margin-right:10px;border: 2px solid #EB6BAD;">
												<f:param name="moviePrice" value="#{item.moviePrice}"></f:param>
												<f:param name="movieId" value="#{item.movieId}"></f:param>
												<f:param name="movieName" value="#{item.movieName}"></f:param>
												<f:param name="action" value="book"></f:param>
											</p:commandButton>
										</div>
										<h:form>
											<p:dialog header="Infomation Setup Box" widgetVar="dlg"
												id="dlg" width="600" height="530" resizable="false">
											</p:dialog>
										</h:form>
									</div>
									<div
										style="width: 100%; height: 85%; float: left; overflow: auto; font-size: 20px">
										<h:outputText value="#{item.description}" escape="flase"></h:outputText>
									</div>

								</div>
							</div>
						</p:dataGrid>
					</h:panelGroup>

					<p:commandLink rendered="#{loginBean.role==4}" update=":payment"
						oncomplete="PF('bar').show()">
						<p:graphicImage style="float:right;margin-top:15px"
							url="images/paymovie.jpg"></p:graphicImage>
					</p:commandLink>
					<!-- bar payment -->


				</h:form>

				<h:form id="dlgform">
					<p:dialog header="#{msg['movie_home_confirm']}" widgetVar="dlg" id="dlg" width="450"
						height="260" resizable="false" modal="true" draggable="false">
						<h:panelGroup id="dlgOrder" rendered="#{loginBean.role==4}">
							<h:inputHidden value="#{ordermoviebean.id}"></h:inputHidden>
							<table style="font-size: 15px;">

								<tr style="height: 50px">
									<td style="text-align: right;"><h:outputText
											value="#{msg['book_movie_name']}: " /></td>
									<td style="text-align: left:;"><span
										style="margin-left: 20px"></span>#{ordermoviebean.nameMovie}</td>
								</tr>
								<h:inputHidden value="#{ordermoviebean.id}" escape="false"></h:inputHidden>
								<tr style="height: 50px">
									<td style="text-align: right;"><h:outputText
											value="#{msg['price']}: " /></td>
									<td style="text-align: left:;"><span
										style="margin-left: 20px"></span>#{ordermoviebean.priceStr}$<br></br></td>
								</tr>
								<tr style="height: 50px">
									<td style="text-align: right;"><h:outputText
											value="#{msg['movie_home_cd']}: " /></td>
									<td style="text-align: left;"><span
										style="margin-left: 20px"></span> <p:calendar
											value="#{ordermoviebean.movieTime}"
											mindate="#{ordermoviebean.minDate}"
											pattern="yyyy/MM/dd HH:mm:ss">
										</p:calendar></td>
								</tr>
								<tr>
									<td colspan="2"><h:outputText
											value="*#{msg['movie_home_message']}"
											style="color:red;font-weight: bold;font-size:17px"></h:outputText></td>
								</tr>
								<tr style="height: 50px;">
									<td></td>
									<td><p:commandButton style="margin-left:30px"
											value="#{msg['Submit']}" action="#{ordermoviebean.insert()}"
											oncomplete="dlg.hide()" update=":growl">
										</p:commandButton> <p:commandButton value="#{msg['btn_cancel']}" onclick="dlg.hide()"></p:commandButton>
									</td>
								</tr>

							</table>
						</h:panelGroup>
					</p:dialog>
				</h:form>
			</div>
		</div>
	</div>
	<!-- payment -->
	<p:notificationBar rendered="#{loginBean.role==4}" id="payment"
		position="top" effect="slide" widgetVar="bar" styleClass="top"
		style="margin-left:20% ;width:980px;height:300px;border-radius:0px 0px 10px 10px;border-color: rgb(149, 81, 213) ;border-width: 2px ;">
		<div style="font-size: 20px;">
			<div
				style="width: 100%; height: 40px; background-color: #CA96D9; border-radius: 5px 5px 0px 0px">
				<h2
					style="font-weight: bold; color: white; text-align: left; margin-top: 10px; margin-left: 30px">My
					Ticket</h2>
			</div>
			<h:form id="form2">
				<h:panelGroup id="mainform2">
					<p:dataTable rendered="#{loginBean.role==4}" styleClass="myTable"
						var="item" editable="true" rowIndexVar="row"
						value="#{ordermoviebean.listBookMovie}" scrollable="true"
						scrollHeight="155">

						<p:column headerText="Stt" style="width:51px" width="50">
							<h:outputText value="#{row+1}" />
						</p:column>
						<p:column headerText="#{msg['book_movie_name']}:" style="width:151px" width="150">
							<h:outputText style="float:left;"
								value="#{item.ownMovie.movieName}" />
						</p:column>
						<p:column headerText="#{msg['book_movie_price']}:" style="width:150px"
							width="151">
							<h:outputText style="float:left;"
								value="#{item.ownMovie.priceStr}$" />
						</p:column>
						<p:column headerText="#{msg['book_movie_time']}:">
							<h:outputText style="float:left;" value="#{item.movieTime}" />
						</p:column>

						<!--  xoa' book movie, tam thoi bo
												<p:column headerText="Delete" style="width:100px;">
													<h:inputHidden value="#{item.id}"></h:inputHidden>
													<p:commandLink action="#{ordermoviebean.delete()}" update=":payment,:growl" style="float:left;margin-right:15px;margin-left:30px;margin-top:7px;"  >
														<img src="images/del.jpg" title="delete" />
														<f:param value="#{item.id}" name="idMovie"></f:param>
													</p:commandLink>
												</p:column>
												 -->
					</p:dataTable>
					<p:commandButton style="float:right" value="#{msg['btn_cancel']}"
						onclick="PF('bar').hide()" type="button" />
					<div
						style="width: 250px; float: right; margin-right: 10px; margin-top: 5px">
						<h:outputLink value="recharge_home.xhtml"
							style="text-decoration: none !important;">
							<h:outputText value="#{msg['movie_home_linkpay']}" />
						</h:outputLink>
					</div>
				</h:panelGroup>
			</h:form>

		</div>

	</p:notificationBar>
	<ui:insert name="header">
		<ui:include src="/footer/footer_dth.xhtml" />
	</ui:insert>

</h:body>
</html>